package com.omega_r.libs.omegarecyclerview.viewpager.default_transformers;

import ohos.agp.components.Component;

public class RotateUpTransformer extends ABaseTransformer {

    private final float ROT_MOD = -15.0F;

    public boolean isPagingEnabled() {
        return true;
    }

    @Override
    protected void onTransform(Component component, float position) {
        float width = (float)component.getWidth();
        float rotation = ROT_MOD * position;
        component.setPivotX(width * 0.5F);
        component.setPivotY(0.0F);
        component.setTranslationX(0.0F);
        component.setRotation(rotation);
    }
}
